In this step you first create a new Kanzi Studio project with C application, and then add the code to the C application to print Hello world! to the Kanzi debug console.

Kanzi creates a Kanzi Studio project in <KanziWorkspace>/Projects/<ProjectName>/Tool_project directory and the structure for the Visual Studio solution for your project in <KanziWorkspace>/Projects/<ProjectName>/Application:

/* Core logging */ #include <core/debug/kzc_log.h>
KZ_CALLBACK static kzsError writeToLog(struct KzaApplication* application)
{
/* Prints Hello world! to the Kanzi debug console. */
kzsLog(KZS_LOG_LEVEL_INFO, "Hello world!");
kzsSuccess();
}kzApplicationConfigure function call your writeToLog function when your Kanzi application loads.configuration->onProjectLoaded = writeToLog;


This is what your hello_world.c looks like when you complete this step.
#include <application/kza_application_interface.h>
#include <application/kza_application.h>
/* Core logging */
#include <core/debug/kzc_log.h>
KZ_CALLBACK static kzsError keyInputEventHandler(struct KzaApplication*
application, const struct KzsInputEventKey* inputData)
{
enum KzsInputKey button = kzsInputEventKeyGetButton(inputData);
/* Handle the escape or Q button to exit the application. */
if (button == KZS_KEY_ESC || button == KZS_KEY_Q)
{
kzaApplicationQuit(application);
}
kzsSuccess();
}
KZ_CALLBACK static kzsError writeToLog(struct KzaApplication* application)
{
/* Prints Hello world! to the Kanzi debug console. */
kzsLog(KZS_LOG_LEVEL_INFO, "Hello world!");
kzsSuccess();
}
KZ_CALLBACK void kzApplicationConfigure(const struct KzaSystemProperties*
systemProperties, struct KzaApplicationProperties* configuration)
{
configuration->memoryPoolSize = 20 * 1024 * 1024;
configuration->binaryName = "Hello_World.kzb.cfg";
configuration->onKeyInputEvent = keyInputEventHandler;
/* Calls the writeToLog function when the project is loaded. */
configuration->onProjectLoaded = writeToLog;
}